package com.lxy.mybatis.pojo.User;

import java.io.Serializable;
import java.util.Objects;

//开始二级缓存步骤三、查询数据所转化的实体类必须实现序列化接口
public class Emp implements Serializable{ //实现二级缓存的读写方法
    private Integer eid;
    private String empName;
    private Integer age;
    private char sex;
    private String email;
    private Integer did;

    public Emp(Integer eid, String empName, Integer age, char sex, String email, Double salary, EnumStatus enumStatus) {
        this.eid = eid;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
        this.email = email;
//        this.did = did;
        this.salary = salary;
        this.enumStatus = enumStatus;
//        this.dept = dept;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    private Double salary;

    public Emp(Integer eid, String empName, Integer age, char sex, String email, EnumStatus enumStatus) {
        this.eid = eid;
        this.empName = empName;
        this.age = age;
        this.sex = sex;
        this.email = email;
        this.enumStatus = enumStatus;
    }

    public EnumStatus getEnumStatus() {
        return enumStatus;
    }

    public void setEnumStatus(EnumStatus enumStatus) {
        this.enumStatus = enumStatus;
    }

    private EnumStatus enumStatus;
    public Emp(Integer eid) {
        this.eid = eid;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    //    （一对象）多对一
    private Dept dept;
//, int did

    public Emp() {
    }

    public Integer getEid() {
        return eid;
    }

    public void setEid(int eid) {
        this.eid = eid;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getDid() {
        return did;
    }

    public void setDid(int did) {
        this.did = did;
    }


    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        Emp emp = (Emp) o;
        return sex == emp.sex && Objects.equals(eid, emp.eid) && Objects.equals(empName, emp.empName) && Objects.equals(age, emp.age) && Objects.equals(email, emp.email) && Objects.equals(did, emp.did) && Objects.equals(dept, emp.dept);
    }

    @Override
    public int hashCode() {
        return Objects.hash(eid, empName, age, sex, email, did, dept);
    }

    @Override
    public String toString() {
        return "Emp{" +
                "eid=" + eid +
                ", empName='" + empName + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", email='" + email + '\'' +
                ", did=" + did +
                ", enumStatus=" + enumStatus +
                ", dept=" + dept +
                '}';
    }
}
